import { Message } from "node-nats-streaming";
import { Listener } from "./base-listener";
import { Subjects } from "./subjects";
import { TicketUpdatedEvent } from "./ticket-event";

export class TicketUpdatedListener extends Listener<TicketUpdatedEvent>{
    subject: Subjects.TicketUpdated = Subjects.TicketUpdated;
    queueGroupName = 'payment-service';

    onMessage(data: TicketUpdatedEvent['data'], msg: Message): void {
        console.log('data', data);
        msg.ack();
    }
}